package com.wtpaint.design.creational.simplefactory;

public class VideoFactory {

//    public Video getVideo(String type) {
//        if ("java".equals(type)) {
//            return new JavaVideo();
//        } else {
//            return new PythonVideo();
//        }
//    }

    public Video getVideo(Class clazz) {
        Video video = null;
        try {
            video = (Video) Class.forName(clazz.getName()).newInstance();
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return video;
    }
}
